package com.wh.wisdomsite.xbox.st.service.impl;

import com.baomidou.mybatisplus.mapper.SqlHelper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.baomidou.mybatisplus.plugins.Page;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.wh.wisdomsite.xbox.st.dao.SupplierMapper;
import com.wh.wisdomsite.xbox.st.entity.Supplier;
import com.wh.wisdomsite.xbox.st.service.ISupplierService;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.io.Serializable;
import java.util.Map;

/**
 * @author 蔡道行
 * @version V1.0
 * @date 14:59 2018/12/24
 * @Copyright 公司版权所有
 * @Company 贵州万华科技有限公司Copyright (c) 2014
 */
@Service("supplierService")
@Transactional(rollbackFor = {Exception.class, RuntimeException.class})
public class SupplierServiceImpl extends ServiceImpl<SupplierMapper,Supplier> implements ISupplierService{

    private static final Log logger = LogFactory.getLog(SupplierServiceImpl.class);

    @Autowired
    private SupplierMapper supplierMapper;

    @Override
    public Map<String, Object> getMapById(Serializable id) {
        return supplierMapper.getMapById(id);
    }

    @Override
    public Page<Map<String, Object>> getMapsPage(Page page, Wrapper<Supplier> wrapper) {
        SqlHelper.fillWrapper(page,wrapper);
        page.setRecords(this.baseMapper.getMapsPage(page,wrapper));
        return page;
    }
}
